package com.example.klijent;

import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TextView;

public class ListItemDetail extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_item_detail);
		Intent intent = getIntent();
	    int position = intent.getIntExtra("position", 0);
	    ArrayList vrijednosti = intent.getStringArrayListExtra("lista");
	    // Here we turn your string.xml in an array
	    //String[] myKeys = getResources().getStringArray(R.array.sections);
	    String x=(String) vrijednosti.toArray()[position];
	    String[] podaci = x.split("\\|");
	    
	    	TextView nlinije = (TextView) findViewById(R.id.nlinije);
	    	TextView nprevoznik = (TextView) findViewById(R.id.nprevoznik);
	    	TextView nstanica = (TextView) findViewById(R.id.nstanica);
	    	TextView cijena = (TextView) findViewById(R.id.cijena);
	    	TextView udaljenost = (TextView) findViewById(R.id.udaljenost);
		    nlinije.setText(podaci[0]);
		    nprevoznik.setText(podaci[1]);
		    nstanica.setText(podaci[2]);
		    cijena.setText(podaci[3]);
		    udaljenost.setText(podaci[4]);
	    
	    

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.list_item_detail, menu);
		return true;
	}

}
